//
//  WorkingTableViewController.m
//  project
//
//  Created by 张亚林 on 2017/10/31.
//  Copyright © 2017年 Macmini. All rights reserved.
//

#import "WorkingTableViewController.h"

#import "WorkingTableViewCell.h"
#import "DYSegmentView.h"

@interface WorkingTableViewController ()<DYSegmentDelegate>

@property(nonatomic,strong)DYSegmentView *dySegment;

@end

@implementation WorkingTableViewController

- (DYSegmentView *)dySegment{

    if (!_dySegment) {
        _dySegment = [[DYSegmentView alloc]initWithFrame:CGRectMake(ScreenWidth/2-120, 25, 240, 44)];
        _dySegment.delegate         = self;
        _dySegment.backgroundColor  = [UIColor clearColor];
        _dySegment.titleNormalColor = UIColorFromRGB(0xffffff, 0.5);
        _dySegment.titleSelectColor = UIColorFromRGB(0xffffff, 0.9);
        _dySegment.titleFont        = [UIFont systemFontOfSize:15];
        _dySegment.titleArray       = @[@"在线",@"附近"];
    }
    return _dySegment;
}

- (void)viewDidLoad {
    
    [super viewDidLoad];
//    self.navigationController.navigationBar.shadowImage=[UIImage new];
//    [ self.navigationController.navigationBar setBarTintColor:UIColorFromRGB(0x000000, 1.0)];//纯粹为了界面好看
    
   self.navigationItem.titleView = self.dySegment;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 2;
}

//行高
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 212;
}
////区头高度
//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
//
//    return 10;
//}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    WorkingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"workingTableViewCell"];
    if (!cell) {
        cell = [[[NSBundle mainBundle]loadNibNamed:@"WorkingTableViewCell" owner:self options:nil]lastObject];
        
    }
    
    return cell;
}




@end
